package com.yeung.exam;

import java.util.Arrays;
import java.util.Scanner;

public class 小马智行_评估 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int inpu[] = new int[n];
        for (int i = 0; i < n; i++) {
            inpu[i] = sc.nextInt();
        }
        //
        double maxAvg = 0.0;
        for (int i = 0; i <= n - k; i++) {
            int start = i;
            int step = k;
            double tmp = calAvg(Arrays.copyOfRange(inpu, i, i + step));
            if (tmp > maxAvg)
                maxAvg = tmp;
        }
        System.out.println(maxAvg);
    }

    static double calAvg(int[] tmp) {
        Tuple tuple = minAndMaxIndex(tmp);
        int sum = 0;
        for (int i = 0; i < tmp.length; i++) {
            if (i != tuple.min && i != tuple.max)
                sum += tmp[i];
        }
        return sum * 1.0 /(tmp.length - 2);
    }

    static Tuple minAndMaxIndex(int[] data) {
        int min = Integer.MAX_VALUE;
        int minIndex = 0;
        int max = Integer.MIN_VALUE;
        int maxIndex = 0;

        for (int i = 0; i < data.length; i++) {
            int datum = data[i];
            if (datum < min) {
                min = datum;
                minIndex = i;
            }
            if (datum > max) {
                max = datum;
                maxIndex = i;
            }
        }
        return new Tuple(minIndex, maxIndex);
    }

    static class Tuple {
        int min;
        int max;

        public Tuple(int min, int max) {
            this.min = min;
            this.max = max;
        }
    }
}
